//
//  LSZListTableViewCell.m
//  JKFuYinProject
//
//  Created by 九酷 on 2018/6/8.
//  Copyright © 2018年 LC. All rights reserved.
//

#import "LSZListTableViewCell.h"

@implementation LSZListTableViewCell

-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.number = [[UILabel alloc]init];
        self.number.textColor = lightColor;
        self.number.textAlignment = NSTextAlignmentCenter;
        [self addSubview:self.number];

        self.imageViewGoldMedal = [[UIImageView alloc]init];
        [self addSubview:self.imageViewGoldMedal];

        self.imageHeader = [[UIImageView alloc]init];
        [self.imageHeader.layer setMasksToBounds:YES];
        [self addSubview:self.imageHeader];

        self.labelName = [[UILabel alloc]init];
        self.labelName.textColor = titleColorLSZ;
        self.labelName.textAlignment = NSTextAlignmentLeft;
        [self addSubview:self.labelName];

        self.labelNumber = [[UILabel alloc]init];
        self.labelNumber.textAlignment = NSTextAlignmentRight;
        self.labelNumber.textColor = lightColor;
        [self addSubview:self.labelNumber];
        if (ScreenWidth == 320) {
            //5
            self.number.font = FONT_(13.5);
            self.labelName.font = FONT_(13.5);
            self.labelNumber.font = FONT_(12.5);

            self.number.frame = CGRectMake(0, 0, 45, 45);
            self.imageViewGoldMedal.frame = CGRectMake((45-16)/2,(45-20)/2,16,20);
            self.imageHeader.frame = CGRectMake(CGRectGetMaxX(self.number.frame),(45-34)/2, 34, 34);
            [self.imageHeader.layer setCornerRadius:self.imageHeader.frame.size.height/2];
            self.labelName.frame = CGRectMake(CGRectGetMaxX(self.imageHeader.frame)+12,(45-14)/2, ScreenWidth/3+10, 14);
            self.labelNumber.frame = CGRectMake(CGRectGetMaxX(self.labelName.frame), (45-14)/2, ScreenWidth-CGRectGetMaxX(self.labelName.frame)-15, 14);

        }else if(ScreenWidth == 375){
            // 6 7
            self.number.font = FONT_(14);
            self.labelName.font = FONT_(14);
            self.labelNumber.font = FONT_(13);

            self.number.frame = CGRectMake(0, 0, 55, 50);
            self.imageViewGoldMedal.frame = CGRectMake((55-17)/2,(50-21)/2,17,21);
            self.imageHeader.frame = CGRectMake(CGRectGetMaxX(self.number.frame),(50-36)/2, 36, 36);
            [self.imageHeader.layer setCornerRadius:self.imageHeader.frame.size.height/2];
            self.labelName.frame = CGRectMake(CGRectGetMaxX(self.imageHeader.frame)+12,(50-16)/2, ScreenWidth/3+20, 16);
            self.labelNumber.frame = CGRectMake(CGRectGetMaxX(self.labelName.frame), (50-16)/2, ScreenWidth-CGRectGetMaxX(self.labelName.frame)-15, 16);
        }else {
            //plus
            self.number.font = FONT_(14.5);
            self.labelName.font = FONT_(14.5);
            self.labelNumber.font = FONT_(13.5);

            self.number.frame = CGRectMake(0, 0, 55, 58);
            self.imageViewGoldMedal.frame = CGRectMake((55-17)/2,(58-21)/2,17,21);
            self.imageHeader.frame = CGRectMake(CGRectGetMaxX(self.number.frame),(58-38)/2, 38, 38);
            [self.imageHeader.layer setCornerRadius:self.imageHeader.frame.size.height/2];
            self.labelName.frame = CGRectMake(CGRectGetMaxX(self.imageHeader.frame)+12,(58-18)/2, ScreenWidth/3+50, 18);
            self.labelNumber.frame = CGRectMake(CGRectGetMaxX(self.labelName.frame), (58-18)/2, ScreenWidth-CGRectGetMaxX(self.labelName.frame)-15, 18);

        }


    }
    return self;
}

@end
